#C:\Users\69180\Desktop\a\xxx.txt
def file_open(file_path):
	with open(file_path,'r',encoding='utf-8') as file_object:
		lines = file_object.readlines()
	return lines
	
def copy_line(line):
	with open('Ctrl_CV.txt','a',encoding='utf-8') as file_object:
		"""在这里添加你想更改的内容"""
		file_object.write(line+" ")#line前添加内容为每行前添加，line后为每行后添加内容
		
def file_number(file_name):
	with open(file_name,encoding='utf-8') as file_object:
		content = file_object.read()
		words = content.split()
		num_words = len(words)
		return num_words
	
while True:
	user_input = str(input("\nPlease input file rotion(input 'q' to exit): "))
	if user_input == 'q':
		break
	file_lines = file_open(user_input)
	print("\nThe file open success!")

	for line in file_lines:
		copy_line(line.rstrip())
	split_line = "\n\n" + "-------------------------------------split line-------------------------------------" + "\n\n"
	copy_line(split_line)
	print("\nThe file copy success!")

	msg = "\nThe file has about " + str(file_number('Ctrl_CV.txt')) + " words!"
	print(msg)
	
